﻿@using MyBlog2.Models
@model Dictionary<int,IEnumerable<Article>>
@{
    ViewData["Title"] = "归档";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var articleCount = Convert.ToInt32(ViewBag.totalCount);
}



<div class="cl-cantainer container">
    <div class="row" style="align-items:center">
        <div class="col-md-9 cl-left" style="margin-left:auto;margin-right:auto;">
            @* 归档 *@
            <div class="right-card">
                <div class="right-card-main" style="border:1px solid #D4D4D5;">
                    <div class="row justify-content-between">
                        <div class="col-7" style="align-items:center;">
                            <h5 style="padding:10px 0 10px 20px;">归档</h5>
                        </div>
                        <div class="col-4">
                            <h5 style="float:right;padding:10px 20px 10px 20px;">共&nbsp;<span style="color:#FF9400;">@articleCount</span>&nbsp;篇</h5>
                        </div>
                    </div>
                </div>
            </div>


            @* 文章列表 *@
            @*<div>
                <h4 style="text-align:center;color:#00B5AD;">2020年</h4>
                <div class="right-card">
                    <div class="right-card-main">
                        <div class="row justify-content-between">
                            <div class="col-10" style="align-items:center;">
                                <a href="#" style="float:left;padding:10px 20px 10px 20px;">manjaro美化</a>
                            </div>
                            <div class="col-2">
                                <span style="float:right;padding:10px 20px 10px 20px;">原创</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>*@


            @foreach (var item in Model)
            {
                <div style="margin-top:20px;">
                    <h4 style="text-align:center;color:#00B5AD;">@(item.Key)年 <span style="font-size:12px;margin-left:10px;" class="badge badge-pill badge-primary"> @(item.Value.Count())篇 </span> </h4>
                    <div class="right-card" style="border:0.1px solid #D4D4D5;">
                        <div class="right-card-main" style="margin:0;">
                            @foreach (var art in item.Value)
                            {
                                <div class="row justify-content-between" style="margin:0;border:0.1px solid #D4D4D5;">
                                    <div class="col-10" style="align-items:center;">
                                        <a asp-controller="Home" asp-action="Detial" asp-route-id="@art.Id" style="float:left;padding:10px 0 10px 10px;">
                                            @art.Title
                                            <span class="badge badge-success" style="margin-left:10px;font-size:10px;">@art.CreateTime.ToString("MM月dd日")</span>
                                        </a>
                                    </div>
                                    <div class="col-2">
                                        <span style="float:right;color:#F2711C;border:1px solid;border-color:#F2711C;border-radius:3px;margin: 10px 10px 10px 10px;font-size:12px;">@art.Flag</span>
                                    </div>
                                </div>
                            }
                        </div>
                    </div>
                </div>
            }


        </div>

    </div>
</div>




